import React, { PropTypes } from 'react';
import TweenOne from 'rc-tween-one';

import {Icon, Switch, Popover, Button, Modal, Form, Input, message, Row, Col, DatePicker, Cascader,Upload,} from 'antd';
const FormItem = Form.Item;

import { connect } from 'react-redux';
import { closeMask } from '../action/mask';

import './less/userEdit.less';



const areaData = [{
  value: 'shanghai',
  label: 'Shanghai',
  children: [{
    value: 'shanghaishi',
    label: 'Shanghai',
    children: [{
      value: 'pudongxinqu',
      label: 'Pudong New District',
    }],
  }],
}];

class UserEdit extends React.Component {
  static contextTypes = {

  };

  static defaultProps = {

  };

  constructor(props){
    super(props);
    this.state = {

    }
  }

  componentDidMount(){

  }

  handleUpload(){

  }

  _closeMask(){
      this.props.closeMask();
  }

  render() {
    const { getFieldProps } = this.props.form;
    return (
      <div className="formContainer" form={this.props.form}>
        <div className="fromHead">
          <span className="title">编辑信息</span>
          <span className="option">
            <span>保存</span>
            <span onClick={this._closeMask.bind(this)}>关闭</span>
          </span>
        </div>
        <Form horizontal className="ant-advanced-search-formT">
          <Row gutter={16}>
            <Col sm={12}>
              <FormItem
                label="姓名"
                labelCol={{ span: 10 }}
                wrapperCol={{ span: 14 }}
              >
                <Input placeholder="请输入姓名" size="default" />
              </FormItem>
              <FormItem
                label="英文名"
                labelCol={{ span: 10 }}
                wrapperCol={{ span: 14 }}
              >
                <Input placeholder="请输入英文名" size="default" />
              </FormItem>
              <FormItem
                label="隶属部门"
                labelCol={{ span: 10 }}
                wrapperCol={{ span: 14 }}
              >
                <Cascader options={areaData} />
              </FormItem>
              <FormItem
                label="岗位"
                labelCol={{ span: 10 }}
                wrapperCol={{ span: 14 }}
              >
                <Input placeholder="请输入岗位" size="default" />
              </FormItem>
              <FormItem
                label="籍贯"
                labelCol={{ span: 10 }}
                wrapperCol={{ span: 14 }}
              >
                <Input placeholder="请输入籍贯" size="default" />
              </FormItem>
              <FormItem
                label="出生年月"
                labelCol={{ span: 10 }}
                wrapperCol={{ span: 14 }}
              >
                <DatePicker />
              </FormItem>
              <FormItem
                label="婚姻状况"
                labelCol={{ span: 10 }}
                wrapperCol={{ span: 14 }}
              >
                <Input placeholder="请输入婚姻状况" size="default" />
              </FormItem>
              <FormItem
                label="出生年月"
                labelCol={{ span: 10 }}
                wrapperCol={{ span: 14 }}
              >
                <DatePicker />
              </FormItem>
              <FormItem
                label="手机"
                labelCol={{ span: 10 }}
                wrapperCol={{ span: 14 }}
              >
                <Input placeholder="请输入籍贯" size="default" />
              </FormItem>
              <FormItem
                label="短号"
                labelCol={{ span: 10 }}
                wrapperCol={{ span: 14 }}
              >
                <Input placeholder="请输入籍贯" size="default" />
              </FormItem>
              <FormItem
                label="传真"
                labelCol={{ span: 10 }}
                wrapperCol={{ span: 14 }}
              >
                <Input placeholder="请输入籍贯" size="default" />
              </FormItem>
              <FormItem
                label="专业"
                labelCol={{ span: 10 }}
                wrapperCol={{ span: 14 }}
              >
                <Input placeholder="请输入籍贯" size="default" />
              </FormItem>
              <FormItem
                label="毕业证编号"
                labelCol={{ span: 10 }}
                wrapperCol={{ span: 14 }}
              >
                <Input placeholder="请输入籍贯" size="default" />
              </FormItem>
              <FormItem
                label="标准化岗位"
                labelCol={{ span: 10 }}
                wrapperCol={{ span: 14 }}
              >
                <Input placeholder="请输入籍贯" size="default" />
              </FormItem>
              <FormItem
                label="特长"
                labelCol={{ span: 10 }}
                wrapperCol={{ span: 14 }}
              >
                <Input placeholder="请输入籍贯" size="default" />
              </FormItem>
              <FormItem
                label="外语水平"
                labelCol={{ span: 10 }}
                wrapperCol={{ span: 14 }}
              >
                <Input placeholder="请输入籍贯" size="default" />
              </FormItem>
              <FormItem
                label="转正时间"
                labelCol={{ span: 10 }}
                wrapperCol={{ span: 14 }}
              >
                <DatePicker />
              </FormItem>
              <FormItem
                label="户口性质"
                labelCol={{ span: 10 }}
                wrapperCol={{ span: 14 }}
              >
                <Input placeholder="请输入籍贯" size="default" />
              </FormItem>
              <FormItem
                label="户口所在地"
                labelCol={{ span: 10 }}
                wrapperCol={{ span: 14 }}
              >
                <Input placeholder="请输入籍贯" size="default" />
              </FormItem>
              <FormItem
                label="简历来源"
                labelCol={{ span: 10 }}
                wrapperCol={{ span: 14 }}
              >
                <Input placeholder="请输入籍贯" size="default" />
              </FormItem>
              <FormItem
                label="培训时间"
                labelCol={{ span: 10 }}
                wrapperCol={{ span: 14 }}
              >
                <Input placeholder="请输入籍贯" size="default" />
              </FormItem>
              <FormItem
                label="培训时间"
                labelCol={{ span: 10 }}
                wrapperCol={{ span: 14 }}
              >
                <Input placeholder="请输入籍贯" size="default" />
              </FormItem>
            </Col>
            <Col sm={12}>
              <FormItem
                label="头像"
                labelCol={{ span: 10 }}
                wrapperCol={{ span: 14 }}
              >
                <Upload name="userLogo" action="/upload.do" onChange={this.handleUpload} onClick={(event => {
                    alert('ssss');
                })}>
                  <Button type="ghost">
                    <Icon type="upload" /> 点击上传
                  </Button>
                </Upload>
              </FormItem>
              <FormItem
                label="民族"
                labelCol={{ span: 10 }}
                wrapperCol={{ span: 14 }}
              >
                <Input placeholder="请输入民族信息" size="default" />
              </FormItem>
              <FormItem
                label="身份证号码"
                labelCol={{ span: 10 }}
                wrapperCol={{ span: 14 }}
              >
                <Input placeholder="请输入身份证号码" size="default" />
              </FormItem>
              <FormItem
                label="现地址"
                labelCol={{ span: 10 }}
                wrapperCol={{ span: 14 }}
              >
                <Input placeholder="请输入目前居住地址" size="default" />
              </FormItem>
              <FormItem
                label="入职时间"
                labelCol={{ span: 10 }}
                wrapperCol={{ span: 14 }}
              >
                <DatePicker size="default" />
              </FormItem>
              <FormItem
                label="单位号码"
                labelCol={{ span: 10 }}
                wrapperCol={{ span: 14 }}
              >
                <Input placeholder="请输入单位号码" size="default" />
              </FormItem>
              <FormItem
                label="单位邮箱"
                labelCol={{ span: 10 }}
                wrapperCol={{ span: 14 }}
              >
                <Input placeholder="请输入单位邮箱" size="default" />
              </FormItem>
              <FormItem
                label="学历"
                labelCol={{ span: 10 }}
                wrapperCol={{ span: 14 }}
              >
                <Input placeholder="请输入学历" size="default" />
              </FormItem>
              <FormItem
                label="毕业学校"
                labelCol={{ span: 10 }}
                wrapperCol={{ span: 14 }}
              >
                <Input placeholder="请输入毕业学校" size="default" />
              </FormItem>
              <FormItem
                label="身高"
                labelCol={{ span: 10 }}
                wrapperCol={{ span: 14 }}
              >
                <Input placeholder="请输入身高" size="default" />
              </FormItem>
              <FormItem
                label="业余爱好"
                labelCol={{ span: 10 }}
                wrapperCol={{ span: 14 }}
              >
                <Input placeholder="请输入身高" size="default" />
              </FormItem>
              <FormItem
                label="业余爱好"
                labelCol={{ span: 10 }}
                wrapperCol={{ span: 14 }}
              >
                <Input placeholder="请输入身高" size="default" />
              </FormItem>
              <FormItem
                label="计算机水平"
                labelCol={{ span: 10 }}
                wrapperCol={{ span: 14 }}
              >
                <Input placeholder="请输入计算机水平" size="default" />
              </FormItem>
              <FormItem
                label="血型"
                labelCol={{ span: 10 }}
                wrapperCol={{ span: 14 }}
              >
                <Input placeholder="请输入血型" size="default" />
              </FormItem>
              <FormItem
                label="工作年限"
                labelCol={{ span: 10 }}
                wrapperCol={{ span: 14 }}
              >
                <Input placeholder="请输入工作年限" size="default" />
              </FormItem>
              <FormItem
                label="合同年限"
                labelCol={{ span: 10 }}
                wrapperCol={{ span: 14 }}
              >
                <Input placeholder="请输入合同年限" size="default" />
              </FormItem>
              <FormItem
                label="劳动合同续订"
                labelCol={{ span: 10 }}
                wrapperCol={{ span: 14 }}
              >
                <Input placeholder="劳动合同续订" size="default" />
              </FormItem>
              <FormItem
                label="养老保险个人账号"
                labelCol={{ span: 10 }}
                wrapperCol={{ span: 14 }}
              >
                <Input placeholder="请输入养老保险个人账号" size="default" />
              </FormItem>
              <FormItem
                label="住房公积金账号"
                labelCol={{ span: 10 }}
                wrapperCol={{ span: 14 }}
              >
                <Input placeholder="请输入住房公积金账号" size="default" />
              </FormItem>
              <FormItem
                label="培训内容"
                labelCol={{ span: 10 }}
                wrapperCol={{ span: 14 }}
              >
                <Input placeholder="请输入培训内容" size="default" />
              </FormItem>
              <FormItem
                label="医疗保险个人账号"
                labelCol={{ span: 10 }}
                wrapperCol={{ span: 14 }}
              >
                <Input placeholder="请输入培训内容" size="default" />
              </FormItem>
              <FormItem
                label="培训结果"
                labelCol={{ span: 10 }}
                wrapperCol={{ span: 14 }}
              >
                <Input placeholder="请输入培训结果" size="default" />
              </FormItem>
            </Col>
          </Row>
          <Row>
              <Col span={24}>
                <FormItem
                  id="control-textarea"
                  label="培训经历"
                  labelCol={{ span: 4 }}
                  wrapperCol={{ span: 20 }}
                >
                  <Input placeholder="请输入培训经历" type="textarea" id="control-textarea" rows="3" />
                </FormItem>
                <FormItem
                  id="control-textarea"
                  label="技术职称"
                  labelCol={{ span: 4 }}
                  wrapperCol={{ span: 20 }}
                >
                  <Input placeholder="请输入培训技术职称" type="textarea" id="control-textarea" rows="3" />
                </FormItem>
                <FormItem
                  id="control-textarea"
                  label="岗位变动"
                  labelCol={{ span: 4 }}
                  wrapperCol={{ span: 20 }}
                >
                  <Input placeholder="请输入培训经历" type="textarea" id="control-textarea" rows="3" />
                </FormItem>
                <FormItem
                  id="control-textarea"
                  label="试用期考核"
                  labelCol={{ span: 4 }}
                  wrapperCol={{ span: 20 }}
                >
                  <Input placeholder="请输入试用期考核" type="textarea" id="control-textarea" rows="3" />
                </FormItem>
              </Col>
          </Row>
          <Row>
            <Col span={24} style={{ textAlign: 'center' }}>
              <Button type="primary" htmlType="submit">保存</Button>
            </Col>
          </Row>
        </Form>
      </div>
    )
  }
}

UserEdit = Form.create()(UserEdit);

const mapStateToProps = (state) => {
  return {
    maskStatus: state.mask.maskStatus
  }
}

export default connect(
  mapStateToProps,
  { closeMask }
)(UserEdit)
